import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'wallpaper_client_plugin_platform_interface.dart';

/// An implementation of [WallpaperClientPluginPlatform] that uses method channels.
class MethodChannelWallpaperClientPlugin extends WallpaperClientPluginPlatform {
  /// The method channel used to interact with the native platform.
  @visibleForTesting
  final methodChannel = const MethodChannel('wallpaper_client_plugin');

  @override
  Future<String?> getPlatformVersion() async {
    final version = await methodChannel.invokeMethod<String>('getPlatformVersion');
    return version;
  }


  @override
  Future<bool?> sensorsAvailable() async {
    final flag = await methodChannel.invokeMethod<bool>('sensorsAvailable');
    return flag;
  }

  @override
  void downloadWallpaper(Map catelogItem) {
    methodChannel.invokeMethod<bool>('downloadWallpaper', catelogItem);
  }

  @override
  void setWallpaper(Map catelogItem) {
    methodChannel.invokeMethod<bool>('setWallpaper', catelogItem);
  }
}
